﻿@model Kooboo.CMS.Web.Areas.Sites.Models.ExportSiteModel
@{
    ViewBag.Title = "Export the site".Localize();
    Layout = "~/Views/Shared/Blank.cshtml";
}
@section Panel{
    <ul class="panel">
        <li>
            <a data-download-form="" data-return="@ViewContext.RequestContext.GetRequestValue("return")">
                @Html.IconImage("save") @("Save".Localize())</a>
        </li>
        @foreach (var group in Kooboo.CMS.Sites.Extension.UI.TopToolbar.ToolbarButtons.GetToolbarButtons(ViewContext.RequestContext))
        {
            @Html.Partial("_ToolbarGroupButtons", group)
        }
        <li>
            <a href="@ViewContext.RequestContext.GetRequestValue("return")">
                @Html.IconImage("cancel") @("Back".Localize())</a>
        </li>
    </ul>
}
<div class="block common-form">
    <h1 class="title">@ViewBag.Title : <strong>@ViewContext.RequestContext.GetRequestValue("siteName")</strong></h1>
    @using (Html.BeginForm(ViewContext.RequestContext.GetRequestValue("Action"), ViewContext.RequestContext.GetRequestValue("Controller"), FormMethod.Post, new { target = "_blank" }))
    { 
        @Html.ValidationSummary(true)        
        <table>
            <tbody>
                @Html.HiddenFor(m => m.SiteName)
                @Html.EditorFor(m => m.ExportType, new { HtmlAttributes = new { @class = "medium" } })
                @Html.EditorFor(m => m.IncludeSubSites)
            </tbody>
        </table>        
    }
</div>
<script>
    $(function () {
        $('#ExportType').change(function () {
            var $exportType = $(this);
            switch ($exportType.val()) {
                case '2':
                    $('#IncludeSubSites').parent().parent().hide();
                    break;
                default:
                    $('#IncludeSubSites').parent().parent().show();
            }
        });
    });
</script>

